#include "MergeBuffer.h"

//CONSTRUCTOR
MergeBuffer::MergeBuffer(int mergeBufferSize) {
	if (mergeBufferSize > 0)
		this->mergeBufferSize = mergeBufferSize;
	else
		this->mergeBufferSize = BUFFER_SIZE;

	this->buffer = new RegistroIndiceMemoria *[this->mergeBufferSize];
}

// DESTRUCTOR
MergeBuffer::~MergeBuffer() {
	delete [] buffer;
}

/* REDEFINICION DEL OPERADOR [] */
RegistroIndiceMemoria * MergeBuffer::operator[](int indice) {
	return ( buffer[indice] );
}

void MergeBuffer::setRegistro(int index, RegistroIndiceMemoria * reg) {
	buffer[index] = reg;
}

int MergeBuffer::getBufferSize() {
	return this->mergeBufferSize;
}
